package com.diaosidadui;

import com.diaosidadui.domain.Student;

public class TestObjectArray {
    public static void main(String[] args) {
        Student zhangSan = new Student();
        Student liSi = new Student();
        Student wangWu = new Student();
        Student[] arr = new Student[3];

        zhangSan.setName("张三");
        zhangSan.setAge(23);
        liSi.setName("李四");
        liSi.setAge(24);
        wangWu.setName("王五");
        wangWu.setAge(25);

        arr[0]= zhangSan;
        arr[1]= liSi;
        arr[2]= wangWu;
        for (int i = 0; i < arr.length; i++) {

            System.out.println(arr[i].getName()+arr[i].getAge());
        }


    }
}
